#include <asm.h>
#include <regdef.h>
#include <new_inst_test.h>

LEAF(my24_bnel_test)
    .set noreorder
    addiu s0,s0,1
    li    s2,0
###test inst
    TEST_BNE_LIKE(0x47233,0x11003,bnel_not_jump_0,bnel_jump_0);
    TEST_BNE_LIKE(0x3eb3a,0xfffc955,bnel_not_jump_1,bnel_jump_1);
    TEST_BNE_LIKE(0x23ae1,0x12532,bnel_not_jump_2,bnel_jump_2);
    TEST_BNE_LIKE(0x47705,0xfffffbd9,bnel_not_jump_3,bnel_jump_3);
    TEST_BNE_LIKE(0xffffd430,0xb7039,bnel_not_jump_4,bnel_jump_4);
    TEST_BNE_LIKE(0x4421b,0x13320,bnel_not_jump_5,bnel_jump_5);
    TEST_BNE_LIKE(0xfffff60a,0x35e294,bnel_not_jump_6,bnel_jump_6);
    TEST_BNE_LIKE(0x36911,0xb7039,bnel_not_jump_7,bnel_jump_7);
###detect exception
    bne s2,zero,inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
test:
    beq s0,s3,inst_error
    nop
    addiu s3,s3,1
    j test
    nop
inst_error:
    sll t1, s0, 24
    or t0, t1, s3
    sw t0, 0(s1)
    jr ra
    nop
END(my24_bnel_test)
